package logic

import (
	"context"

	"wxapi/internal/services"
	"wxapi/internal/svc"
	"wxapi/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type GetDoctorIdleDateLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewGetDoctorIdleDateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetDoctorIdleDateLogic {
	return &GetDoctorIdleDateLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *GetDoctorIdleDateLogic) GetDoctorIdleDate(req *types.GetDoctorIdleDateReq) (resp *types.GetDoctorIdleDateResp, err error) {
	dates, err := services.GetDoctorIdleDate(l.ctx, l.svcCtx, req.DoctorID)
	if err != nil {
		return nil, err
	}

	resp = &types.GetDoctorIdleDateResp{
		Date: dates,
	}
	return
}
